#!/bin/sh
# $Id: cron.sh 1878 2008-02-12 10:56:45Z luigi $

for site in /etc/drupal/6/sites/* ; do
	BASE_URL=""

	if [ ! "`basename $site`" = "all" ]; then
		for file in $site/baseurl.php $site/settings.php; do
			[ -f "$file" ] && BASE_URL=`grep '^$base_url' $file | cut -d"'" -f2`
			[ "X$BASE_URL" != "X" ] && break
		done

		if [ "X$BASE_URL" = "X" ] ; then
			BASE_URL='http://localhost/drupal6'
		fi

		curl --silent --compressed --location $BASE_URL/cron.php
	fi
done
